<?php
declare (strict_types = 1);

namespace app\model;

use app\model\Activity as ActivityModel;
use think\facade\Db;
use think\Model;

/**
 * @mixin Model
 */
class Activity extends BaseModel
{
    // 设置当前模型对应的数据表
    protected $name = 'activity';

    protected $json = ['scene','applet_ids'];

    //类型
    const TYPE_COMMON = 'common';//通用
    const TYPE_MID_AUTUMN = 'mid_autumn';//中秋
    const TYPE_ARR = [
        self::TYPE_COMMON => '通用',
        self::TYPE_MID_AUTUMN => '中秋',
    ];

    //状态
    const STATUS_VALID = 'valid';
    const STATUS_INVALID = 'invalid';
    const STATUS_ARR = [
        self::STATUS_VALID => '有效的',
        self::STATUS_INVALID => '无效的',
    ];

    //场景
    //1、通过链接进入视频播放页面，观看到收费集数用户点关闭充值后弹出弹窗，可直接通过弹窗进行支付下单。
    const SCENE_PAY_CANCEL = 'pay_cancel';
    //2、首页Banner图，点击弹出弹窗
    const SCENE_HOMEPAGE_BANNER = 'homepage_banner';
    //3、在线10分钟以上用户进入首页，会弹出一次弹窗
    const SCENE_TEN_MIN = 'ten_min';
    const SCENE_ARR = [
        self::SCENE_PAY_CANCEL => '播放剧集时关闭充值',
        self::SCENE_HOMEPAGE_BANNER => '点击Banner',
        self::SCENE_TEN_MIN => '在线10分钟',
    ];
}
